package com.smart.tool.extension.repository;

import java.util.Collection;

import com.smart.tool.extension.SenceParam;
import com.smart.tool.extension.model.ExtensionSence;

/**
 * 扩展点加载器
 */
 public interface IExtensionRepository {


    <T> Collection<T> getExtensionList(Class<T>searchClass);

   /**
    * 项目启动点时候将对象加载到缓存中
    *
    * @param extensionSence
    * @return
    */
   void loadExtension(Object extension, ExtensionSence extensionSence);


    /**
     * 获取扩展点
     *
     * @param senceParam
     * @param searchClass
     * @return
     */
    Object getExtension(SenceParam senceParam,Class<?>searchClass);

    /**
     * 获取场景下所有实现到扩展点
     *
     * @param senceParam
     * @param searchClass
     * @return
     */
    Collection<Object> getExtensionList(SenceParam senceParam,Class<?>searchClass);
}
